/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.imenu.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author yunzi
 */
@Entity
@Table(name = "imenu_customer")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ImenuCustomer.findAll", query = "SELECT i FROM ImenuCustomer i"),
    @NamedQuery(name = "ImenuCustomer.findById", query = "SELECT i FROM ImenuCustomer i WHERE i.id = :id"),
    @NamedQuery(name = "ImenuCustomer.findByNickname", query = "SELECT i FROM ImenuCustomer i WHERE i.nickname = :nickname"),
    @NamedQuery(name = "ImenuCustomer.findByMobile", query = "SELECT i FROM ImenuCustomer i WHERE i.mobile = :mobile"),
    @NamedQuery(name = "ImenuCustomer.findByAlipayName", query = "SELECT i FROM ImenuCustomer i WHERE i.alipayName = :alipayName"),
    @NamedQuery(name = "ImenuCustomer.findByDeviceId", query = "SELECT i FROM ImenuCustomer i WHERE i.deviceId = :deviceId")})
public class ImenuCustomer implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id", insertable = false)
    private Integer id;
    @Size(max = 20)
    @Column(name = "nickname")
    private String nickname;
    @Size(max = 20)
    @Column(name = "mobile")
    private String mobile;
    @Size(max = 100)
    @Column(name = "alipay_name")
    private String alipayName;
    @Size(max = 100)
    @Column(name = "device_id")
    private String deviceId;

    public ImenuCustomer() {
    }

    public ImenuCustomer(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getAlipayName() {
        return alipayName;
    }

    public void setAlipayName(String alipayName) {
        this.alipayName = alipayName;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ImenuCustomer)) {
            return false;
        }
        ImenuCustomer other = (ImenuCustomer) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.imenu.entity.ImenuCustomer[ id=" + id + " ]";
    }
}
